import genetics
import trees
import lattice
import tkrenderer

fs = ['+','-','*','%']
ts =['x', 1,2]

gp1 = trees.generateRandomExpr(fs, ts,3,'grow')
gp2 = trees.generateRandomExpr(fs,ts,3,'grow')

lt_init = lattice.parsePopulationToLattice([gp1, gp2])

pop = []
numpop = 10
for i in range(numpop):
    pop += [genetics.crossover(gp1, gp2)]


lt = lattice.parsePopulationToLattice(pop)
print lt_init,"\n"
print lt

tkrenderer.drawPopulation(2, lt_init, 10, 400)
tkrenderer.drawPopulation(numpop, lt, 10, 400)
